package cn.huiyunche.base.service.interfaces.impl;

import cn.huiyunche.base.service.interfaces.TmsOrderStatusHistoryService;
import cn.huiyunche.base.service.mappers.TmsOrderStatusHistoryMapper;
import cn.huiyunche.base.service.model.TmsOrderStatusHistory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @FileName: cn.huiyunche.service.base.interfaces.tms.impl
 * @Description: Description
 * @author: Aaron
 * @date: 2016/11/3 下午3:11
 */
@Service
public class TmsOrderStatusHistoryServiceImpl implements TmsOrderStatusHistoryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(TmsOrderStatusHistoryServiceImpl.class);

    @Autowired
    private TmsOrderStatusHistoryMapper tmsOrderStatusHistoryMapper;

    @Override
    public void add(TmsOrderStatusHistory history) {
        LOGGER.info("add param : {}", history);
        if (null == history) {
            LOGGER.error("add param history must not be null");
            throw new IllegalArgumentException("订单变更历史不能为空");
        }

        tmsOrderStatusHistoryMapper.insertSelective(history);
    }
}
